quartz: gtk-application - inhibit openFiles events from cmdline
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Thu, 18 Jun 2020 19:08:28 +0000 (21:08 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jun 2020 20:42:54 +0000 (16:42 -0400)
commita614716d0fd2fa6c157ba35ea5013468a2b93a19
treedf33572b03cb8dcf5f4b06340849feb65c641667
parent94f246240dd0b1abe962a10b91d19bd4e7ce1e47
quartz: gtk-application - inhibit openFiles events from cmdline

When an application is started via cmdline, then openFiles events
from MacOS are generated although gtkapplication already interprets
the cmdline arguments and opens suitable arguments as files. So they
would be opened twice. Depending on the exact situation the
openFiles event can also be issued before the startup signal
is given. Depending on the application this can result in a crash
due to unexpected behaviour. I took this idea from the
gedit-app-osx.m file. Also from Jesse van den Kieboom.

See:
https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2098#note_842975
https://gitlab.gnome.org/GNOME/gtk/-/commit/a3ad7fa80f764fb7bcbe
https://gitlab.gnome.org/GNOME/gedit/-/blob/master/gedit/gedit-app-osx.m#L592
gtk/gtkapplication-quartz.c